home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / ZIPPED / DOS / DATABASE / PDOXLIB.ZIP / MANUAL.DOC < prev    next >
Text File  |  1993-01-09  |  76KB  |  4,820 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                      INTRODUCTION
  8.  
  9.  
  10.  
  11.           Welcome to PDOXLIB!
  12.  
  13.           PDOXLIB is a collection of nearly 70 Paradox routines written
  14.           entirely in PAL Version 4.0.
  15.  
  16.           The routines range from the simple to the complex and from the
  17.           workhorses to the fun.
  18.  
  19.           You'll find lots of routines that prompt the user for information
  20.           in different ways. You'll find routines that format data and ones
  21.           that remove or replace unwanted characters.
  22.  
  23.           But you'll also find a handy gauge routine that keeps the user
  24.           informed of the progress of your calculations. A crawl routine
  25.           prints an attractive message across the bottom of the screen.
  26.  
  27.           There's even a pop-up calendar written entirely in PAL! Few busy
  28.           programmers would take the time to write such a routine, but it's
  29.           the type of finishing touch that adds class and convenience to
  30.           your hard-working application.
  31.  
  32.           PDOXLIB routines can be used as is or the source code can be
  33.           modified to meet your own needs. The code is liberally commented,
  34.           so making your own changes is easy.
  35.  
  36.           But remember, PDOXLIB is shareware. If you use it you have a
  37.           responsibility to pay for it. There are plenty of good reasons to
  38.           register PDOXLIB, but the point of shareware is to give you the
  39.           chance to try out the software and see if it meets your needs. If
  40.           so, then it's time to put the check in the mail.
  41.  
  42.                             WHY SHOULD I REGISTER PDOXLIB?
  43.  
  44.           The best reason to register PDOXLIB is that it's the right thing
  45.           to do. Hard work went into the creation of PDOXLIB and just as
  46.           you wouldn't want your work stolen, neither does the author of
  47.           PDOXLIB.
  48.  
  49.           But from a practical standpoint, why not register it? The cost is
  50.           only $30. Compared to the cost of writing one or two of these
  51.           routines yourself, it's downright cheap.
  52.  
  53.           The source code alone is worth the price. You may also find you
  54.           love one of the routines, but hate the choice of colors. With the
  55.           source code, the full range of available colors is open to you.
  56.  
  57.           From a practical standpoint, you'll find the PDOXLIB library to
  58.           be quite large. In fact, it's really too large for practical use.
  59.           Adding the library to an existing application would slow your
  60.           program down as the computer searches through another 100,000
  61.           bytes looking for a routine.
  62.  
  63.                                                                           1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           With the source code, you add only the routines you need to your
  74.           libraries and keep your programs running at their peak speeds.
  75.  
  76.           So put PDOXLIB through its paces and if it works for you, then
  77.           drop a check in the mail.
  78.  
  79.           We'd also welcome your comments, suggestions for changes in the
  80.           routines or requests for new routines.
  81.  
  82.           And if you don't like a routine, tell us that too. We want
  83.           PDOXLIB to be a helpful addition to your toolbox.
  84.  
  85.  
  86.                                                                January 1993
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                           2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           How do I make PDOXLIB work?
  140.  
  141.           First copy all the PDOXLIB files into their own directory. Next,
  142.           play the MAKELIB.SC script. The MAKELIB.SC script compiles all
  143.           the other scripts into a library. You can then call the routines
  144.           as procedures from the library.
  145.  
  146.           The scripts are password protected and are designed to write
  147.           their contents to a library, then release themselves from memory.
  148.           Upon registration, you are given the password that opens the
  149.           script to you for use.
  150.  
  151.           To call the routines from the library, first declare PDOXLIB as
  152.           your autolib with the following declaration: autolib = "PDOXLIB",
  153.           assuming PDOXLIB is in the current directory. This may be called
  154.           from a script or a miniscript.
  155.  
  156.           The following pages give you the syntax for calling each of the
  157.           PDOXLIB routines. Use this syntax to call the routines.
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                           3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.           atprint
  208.  
  209.           Description: Prints a string of text in a specified attribute at
  210.           a row and column position on the canvas.
  211.  
  212.           Syntax: atprint.u(text.a, attrib.n, row.n, col.n)
  213.  
  214.           Where:  text.a  . .  is the text to be printed
  215.                   attrib.n  .  is the attribute number for the text.
  216.                   row.n . . .  is the row where the text is to be printed.
  217.                   col.n . . .  is the column where the text is to be
  218.           printed.
  219.  
  220.  
  221.           While any beginning PAL programmer can handle the writing of this
  222.           code, this routine provides a code-reusable way of handling a
  223.           regular chore. The advantage of this routine is that is allows
  224.           you to specify the color attribute of the text to be printed.y
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                                                           4
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.           bgetdate
  274.  
  275.           Description: Prompts the user for a date via the dialog box. The
  276.           procedure uses PAL's ACCEPT statement for getting data.
  277.  
  278.           Syntax: newdate.d = bgetdate.d ()
  279.  
  280.           Where:  newdate.d .  receives a new, valid date
  281.  
  282.  
  283.           This routine pops a dialog box into the center of the screen and
  284.           prompts the user to enter a day in the MM/DD/YY format. Because
  285.           ACCEPT is used, only a valid date may be entered.
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                                                           5
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.           bgetphone
  340.  
  341.           Description: Prompts the user for a telephone number via a dialog
  342.           box on the screen. It uses the PAL ACCEPT command and requires an
  343.           area code entry. The routine returns a string in the format: NNN-
  344.           NNN-NNNN.
  345.  
  346.           Syntax: phonenumber.a = bgetphone.a ()
  347.  
  348.           Where:  phonenumber.a receives a formatted telephone number
  349.  
  350.  
  351.           Although Paradox provides validation checks for field data entry,
  352.           there are times, such as when prompting for query information,
  353.           where a dialog box is helpful. This routine pops a box onto the
  354.           center of the screen and prompts the user to enter a telephone
  355.           number in the NNN-NNN-NNNN format.
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                                                           6
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.           bgetssn
  406.  
  407.           Description: Prompts the user for a social security number via a
  408.           dialog box on the screen. It uses the PAL ACCEPT command. The
  409.           routine returns a string in the format: NNN-NN-NNNN.
  410.  
  411.           Syntax: ssn.a = bgetssn.a ()
  412.  
  413.           Where:  ssn.a . . .  receives a formatted social security number
  414.  
  415.  
  416.           Although Paradox provides validation checks for field data entry,
  417.           there are times, such as when prompting for query information,
  418.           where a dialog box is helpful. This routine pops a box onto the
  419.           center of the screen and prompts the user to enter a social
  420.           security number in the NNN-NN-NNNN format.
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                                                           7
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.           calcage
  472.  
  473.           Description: Using a date of birth, the routine returns the
  474.           person's age.
  475.  
  476.           Syntax: currentage.n = calcage.n (dob.d)
  477.  
  478.           Where:  dob.d . . .  is a date variable representing the
  479.           person's date of     birth.
  480.                   currentage.n  receives the age calculated from the date
  481.           of birth
  482.  
  483.  
  484.           The routine can be used when an age instead of a date is needed.
  485.           It can also be used to fill in an age field if only a date of
  486.           birth field exists. If procedures are allowed in forms in future
  487.           versions of Paradox, the routine might also be useful to keep an
  488.           accurate running age of a person when only the date of birth is
  489.           available.
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                                                                           8
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.           checkprinter
  538.  
  539.  
  540.           Description:  Checks to see if the printer is ready to receive
  541.           text.
  542.  
  543.           Syntax: ready.l = checkprinter.l ()
  544.  
  545.           Where:  ready.l . .  receives true if the printer is ready and
  546.           false if the user wishes to quit.
  547.  
  548.  
  549.           While the programmer can easily us PAL's PRINTERSTATUS function
  550.           to check the printer, you must still deal with the results of
  551.           that decision.
  552.  
  553.           The routine does this by quickly returning true if the printer is
  554.           ready. If it is not, a dialog box is presented to the user who
  555.           can fix the problem, click OK and continue. The user may also
  556.           decide to press ESC or CANCEL and abort the decision to print.
  557.  
  558.           The routine gives the programmer a one-stop place to check on the
  559.           printer before moving on.
  560.  
  561.           Note that the routine does not deal with printer problems once
  562.           printing has begun. Those errors are generally handled by an
  563.           error handling routine. The errorlog routine provided with
  564.           PDOXLIB is designed to handle those problems.
  565.  
  566.           You should also note that the PRINTERSTATUS function is erratic
  567.           at best. You should throughly test the routine on your hardware
  568.           before trusting that function or this routine.
  569.  
  570.           Printer problems are often best handled by the ERRORPROC
  571.           procedure. The PDOXLIB ERRORLOG routine provides this service.
  572.  
  573.           For more information on setting the ERRORPROC system variable,
  574.           consult your Paradox manuals.
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                                                           9
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.           comparestruct
  604.  
  605.  
  606.           Description:  Compares the structure of two tables to see if they
  607.           are identical.
  608.  
  609.           Syntax: test.l = comparestruct.l (table1.a, table2.a)
  610.  
  611.           Where:  test.l  . .  is set to true if they are equal, false if
  612.           they are not
  613.                   table1.a  .  is the name of the first table
  614.                   table2.a  .  is the table to compare to the first table
  615.  
  616.  
  617.           Often when doing queries or copying reports or forms, you need to
  618.           know if two tables have compatible structures. The routine
  619.           provides an easy way to do the comparison.
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.                                                                          10
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.           copyfamily
  670.  
  671.  
  672.           Description:  Copies just Paradox families members from one table
  673.           to another.
  674.  
  675.           Syntax: copyfamily.u (sourcetable.a, targettable.a)
  676.  
  677.           Where:  sourcetable.a is the table hosting the family members
  678.                   targettable.a is the table to receive the family members
  679.  
  680.  
  681.           It's the command that Borland forgot! While PAL provides easy
  682.           ways of copying forms and reports among tables, it does not allow
  683.           for copying of just the family members without explicit menu
  684.           calls. This routines does just that.
  685.  
  686.           The routine assumes the structure of the two tables is identical.
  687.           If you are in doubt, use the comparestruct function to find out.
  688.  
  689.           That routine could have been included here to bullet-proof the
  690.           routine, but that would slow down the process considerably --
  691.           especially when it may not be necessary.
  692.  
  693.           The routine gives you the most speed possible and if you need to
  694.           check for compatibility, simply call the verifying routine.
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                                                                          11
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.           crawl
  736.  
  737.           Description: Displays a message that crawls across the bottom of
  738.           the screen to let the user know that work is in progress.
  739.  
  740.           Syntax: crawl.u(message.a)
  741.  
  742.           Where:  message.a .  is the message to be displayed on the craw
  743.  
  744.  
  745.           Crawl is intended to a included in a loop such as WHILE or FOR.
  746.           With each pass through the loop the program determines the
  747.           current position of the message and advances it one column.
  748.  
  749.           For example:
  750.  
  751.                   While true
  752.                      crawl.u("Processing data")
  753.                      ....
  754.                      ....
  755.                      ....
  756.                   Endwhile
  757.  
  758.           While the program is relatively speedy, it does include a short
  759.           pause to make the message readable. For short processing times,
  760.           the routine should not pose a problem, but if the loop is
  761.           expected to take some time, crawl.u will probably provide too
  762.           much of a delay.
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.                                                                          12
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.           delrec
  802.  
  803.           Description:  A routine to delete the record currently hosting
  804.           the cursor.
  805.  
  806.           Syntax: delrec.u ()
  807.  
  808.  
  809.           The routine will delete the current record after prompting the
  810.           user to confirm that choice. The routine can be called from main,
  811.           edit or coedit modes. If called in main mode, the routine will
  812.           return the user to main mode at the conclusion.
  813.  
  814.           One advantage of the routine is that is saves the most recently
  815.           deleted record in memory. By using the companion routine,
  816.           saverec.u, the record can be restored. This is true even if the
  817.           deletion was made in coedit mode, the edit session was ended with
  818.           F2 and the table was removed from the screen.
  819.  
  820.           Only the most recent deletion is held in memory and that is lost
  821.           when the user exits Paradox.
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                                                          13
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.           errorlog
  868.  
  869.           Description: An error procedure that writes system data to a
  870.           Paradox table and writes variables to a file. The file name is
  871.           then stored in the table.
  872.  
  873.           Syntax:              errorproc = "errorlog.u"
  874.  
  875.  
  876.           Errorlog is intended to provide a paper trail of problems that
  877.           might occur with an application. 
  878.  
  879.           For a programmer called in to handle unusual problems, the
  880.           errorlog table can give the state of the system whenever an error
  881.           occurred. Since the data is written to a Paradox table, it can
  882.           accommodate a great deal of information over a long period of
  883.           time.
  884.  
  885.           Unlike other errorprocedures, errorlog also handles printer
  886.           problems. If a printer times out, the procedure will halt until
  887.           the user resolves the problem, then returns control to the
  888.           printing routine.
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.                                                                          14
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.           evenodd
  934.  
  935.           Description:  Returns "E" or "O" telling whether a number is even
  936.           or odd.
  937.  
  938.           Syntax: result.a = evenodd.a(test.v)
  939.  
  940.           Where:  result.a  .  receives "E", "O" or "Error"
  941.                   test.v  . .  is the number to be examined
  942.  
  943.  
  944.           The routine will accept a number either as a string or in numeric
  945.           format and return "E" or "O" to indicate if the number is even or
  946.           odd.
  947.  
  948.           If the value tested is not entirely numeric (such as in "326B"),
  949.           "Error" is returned.
  950.  
  951.           The routine will work for dates if the value is in the MM/DD/YY
  952.           format.
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.                                                                          15
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.           exitbox
  1000.  
  1001.  
  1002.           Description:  Uses a dialog box to confirm that the user wishes
  1003.           to exit the program.
  1004.  
  1005.           Syntax: confirm.l = exitbox.l ()
  1006.  
  1007.           Where:  confirm.l .  returns true if the user wishes to exit
  1008.  
  1009.  
  1010.           The routine places a dialog box in the center of the screen that
  1011.           asks the user if he or she wants to exit the program.
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.                                                                          16
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.           findB
  1066.  
  1067.  
  1068.           Description:  Searches through a string backwards looking for a
  1069.           substring.
  1070.  
  1071.           Syntax: position.n = findB.n(source.a, find.a, start.n)
  1072.  
  1073.           Where:  position.n   receives the location of the substring
  1074.                   source.a  .  is the string to be searched
  1075.                   find.a  . .  is the string to find in source.a
  1076.                   start.n . .  is the position from which to start the
  1077.           search
  1078.  
  1079.  
  1080.           PAL's SEARCH and SEARCHFROM functions will search through a
  1081.           string starting at the beginning looking for a substring. However
  1082.           sometimes you may wish to start from the back of the string. This
  1083.           routine provides that capability.
  1084.  
  1085.           Like SEARCH and SEARCHFROM, it returns the position as counted
  1086.           from the start of the string. The routine is case insensitive.
  1087.  
  1088.           If start.n is left blank, the routine assumes you want the entire
  1089.           string searched.
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.                                                                          17
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.           findtable
  1132.  
  1133.  
  1134.           Description:  Searches through a string looking for the first
  1135.           occurrence of a string listed in the table variable.
  1136.  
  1137.           Syntax: position.n = findtable.n(start.n, source.a, table.a)
  1138.  
  1139.           Where:  position.n   receives the position of the found string
  1140.                   start.n . .  is the position in source.a to begin the
  1141.           search
  1142.                   source.a  .  is the string to be searched
  1143.                   table.a . .  is the table holding the strings to find
  1144.  
  1145.  
  1146.           In some applications, such as those where you are cleaning data,
  1147.           you may wish to remove or change several characters at once to
  1148.           avoid repeated passes through a database. This routine allows you
  1149.           to create a table of characters you wish to examine and locate
  1150.           them within a string.
  1151.  
  1152.           It should be noted the routine only finds the first occurrence of
  1153.           one of the characters in the table variable. For that reason, you
  1154.           may wish to call the routine from a loop and continue the
  1155.           examination until you receive a zero to ensure all characters
  1156.           were found.
  1157.  
  1158.           When creating the table.a variable, no separators are required.
  1159.           For example if you wanted to find all of the punctuation
  1160.           characters created by the top row of the keyboard, your table.a
  1161.           variable declaration would look like:
  1162.  
  1163.                                 table.a = "!@#$%^&*()"
  1164.  
  1165.           If no start position is declared, the routine assumes you want to
  1166.           start at the beginning of the string.  The routine is case
  1167.           insensitive.
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.                                                                          18
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.           findtableB
  1198.  
  1199.  
  1200.           Description:  The routine acts exactly like the findtable.n ()
  1201.           routine except that it begins at the end of a string and works
  1202.           backwards.
  1203.  
  1204.           Syntax: position.n = findtableB.n(start.n, source.a, table.a)
  1205.  
  1206.           Where:  position.n   receives the position of the found string
  1207.                   start.n . .  is the position in source.a to begin the
  1208.           search
  1209.                   source.a  .  is the string to be searched
  1210.                   table.a . .  is the table holding the strings to find
  1211.  
  1212.  
  1213.           See the instructions for the findtable routine for instructions
  1214.           on how the routine works.
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.                                                                          19
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.           fullname
  1264.  
  1265.           Description:  Returns the full path name of the current
  1266.           directory.
  1267.  
  1268.           Syntax: pathname.a = fullname.a(filename.a, styl.n)
  1269.  
  1270.           Where:  filename.a   is the name of a selected file in the
  1271.           current directory
  1272.                   styl.n  . .  selects single or double backslashes
  1273.                   pathname.a   receives the full path name
  1274.  
  1275.  
  1276.           When changing directories within an application, it is often
  1277.           useful to retain valid path names for calling tables or reports
  1278.           later. This utility allows you to capture that information in a
  1279.           variable. 
  1280.  
  1281.           Instead of the filename.a, the user can use the PAL function
  1282.           TABLE (). The routine will then return the full path name of a
  1283.           table, but without the .DB file extension. Of course the table
  1284.           must be on the workspace for the TABLE () function to work
  1285.           properly.
  1286.  
  1287.           Some Paradox functions also require a double backslash in which
  1288.           to work properly. By entering a value of zero, the function will
  1289.           return the path with double backslashes. Any other value will
  1290.           return single backslashes.
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.                                                                          20
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.           getdate
  1330.  
  1331.           Description:  Prompts the user for a date at the current cursor
  1332.           position.
  1333.  
  1334.           Syntax: newdate.d = getdate.d()
  1335.  
  1336.           Where:  newdate.d .  receives a date variable in the MM/DD/YY
  1337.           format
  1338.  
  1339.  
  1340.           Using the ACCEPT command, getdate.d prompts the user for a date.
  1341.           Care must be taken before calling getdate.d to place the cursor
  1342.           in the correct position. The routine offers a plain vanilla way
  1343.           of getting a date. For a more elegant way, see getdate2.
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.                                                                          21
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.           getdate2
  1396.  
  1397.           Description:  A more visual way of getting a date from the user
  1398.           at the current cursor position.
  1399.  
  1400.           Syntax: newdate.d = getdate2.d ()
  1401.  
  1402.           Where:  newdate.d .  receives a date variable in the MM/DD/YY
  1403.           format
  1404.  
  1405.  
  1406.           Unlike getdate.d, getdate2.d provides an image on the screen for
  1407.           the user to complete. By providing that image, it helps the user
  1408.           determine how the date should be entered. The routine checks to
  1409.           see if the date is valid before allowing the user to leave,
  1410.           however the user may press ESC to leave the routine. If so, the
  1411.           routine returns "ESC" to newdate.d.
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.                                                                          22
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.           getnum
  1462.  
  1463.           Description:  Prompts the user to enter a number at the current
  1464.           cursor location.
  1465.  
  1466.           Syntax: newnumber.n = getnum.n ()
  1467.  
  1468.           Where:  newnumber.n  receives a number typed in by the user.
  1469.  
  1470.  
  1471.           This is a simple ACCEPT version of getting a number from the
  1472.           user. Since the style or format of the number is unknown, no
  1473.           formatting or validity checking can be done. If the user leaves
  1474.           the routine without entering a number or by pressing ESC, the
  1475.           routine returns false.
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.                                                                          23
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.           getphone
  1528.  
  1529.           Description:  Prompts the user for a telephone number at the
  1530.           current cursor position.
  1531.  
  1532.           Syntax: newnumber.a = getphone.a ()
  1533.  
  1534.           Where:  newnumber.a  receives a telephone number in the ###-###-
  1535.           #### format.
  1536.  
  1537.  
  1538.           The routine uses PAL's ACCEPT command to return a telephone
  1539.           number.
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.                                                                          24
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.           getphone2
  1594.  
  1595.           Description:  Provides a more visual way of prompting the user
  1596.           for a telephone number at the current cursor location.
  1597.  
  1598.           Syntax: newnumber.a = getphone2.a ()
  1599.  
  1600.           Where:  newnumber.a  receives a telephone number in the ###-###-
  1601.           #### format.
  1602.  
  1603.  
  1604.           getphone2.a provides a more visual way to prompt the user for a
  1605.           telephone number. The routine requires numeric input, but will
  1606.           return ESC if the user escapes out of the routine. The routine
  1607.           could be easily modified to allow a default area code, thus
  1608.           speeding data entry.
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.                                                                          25
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.           getssn
  1660.  
  1661.           Description:  Provides a simple way of prompting the user to
  1662.           enter a social security number at the present cursor location.
  1663.  
  1664.           Syntax: ssn.a = getssn.a ()
  1665.  
  1666.           Where:  ssn.a . . .  receives a social security number in the
  1667.           ###-##-#### format.
  1668.  
  1669.  
  1670.           Using PAL's accept command, this routine provides a quick way of
  1671.           getting a social security number. ESC is returned if the user
  1672.           escapes out of the routine.
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.                                                                          26
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.           getssn2
  1726.  
  1727.           Description:  Provides a more visual way of prompting the user to
  1728.           enter a social security number at the current cursor location.
  1729.  
  1730.           Syntax: ssn.a = getssn2.a ()
  1731.  
  1732.           Where:  ssn.a . . .  receives a social security number in the
  1733.           ###-##-#### format.
  1734.  
  1735.  
  1736.           Provides a more visual way of prompting the user for a social
  1737.           security number. The routine puts an image of the number in the
  1738.           current cursor location and accepts numbers from the user. ESC is
  1739.           returned if the user presses the escape key.
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.                                                                          27
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.           gettext
  1792.  
  1793.           Description:  Gets a line of text at the current cursor location
  1794.           and formats it to all upper case, lower case or capitalizing the
  1795.           first letter of each word.
  1796.  
  1797.           Syntax: newtext.a = gettext.a(length.n, styl.n)
  1798.  
  1799.           Where:  newtext.a .  receives a formatted string of text
  1800.                   length.n  .  is the maximum length of the string
  1801.                   styl.n  . .  is 1, 2 or 3 to indicate the style desired
  1802.  
  1803.  
  1804.           The routine prompts the user to input a string of text at the
  1805.           current cursor location. If the user exits the routine without
  1806.           entering text or by pressing ESC, the routine returns false. 
  1807.  
  1808.           The length.n variable tells the routine how much text should be
  1809.           received from the user. The styl.n variable should be set to 1 if
  1810.           the text is to be returned in all capitals, 2 if it is to be all
  1811.           lower case or 3 if the first letter of each word is to be
  1812.           capitalized. If any other value is entered, the string is
  1813.           returned unaltered.
  1814.  
  1815.           The routine also calls the lrtrim.a routine to ensure that
  1816.           newtext.a receives a string without leading or trailing spaces.
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.                                                                          28
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.           hrs2days
  1858.  
  1859.  
  1860.           Description:  Designed as a companion routine to timeadd.a,
  1861.           hrs2days returns the number of days and hours represented by a
  1862.           time variable.
  1863.  
  1864.           Syntax: days&time.a = hrs2days.a(timeval.a)
  1865.  
  1866.           Where:  days&time.a  is the calculated days and time
  1867.                   timeval.a .  is the time to be evaluated.
  1868.  
  1869.  
  1870.           Following the addition of two time values, the result may extend
  1871.           past one day. This routine was designed to turn those hours into
  1872.           days should the hour value not be appropriate.
  1873.  
  1874.           hrs2days is unique in that it returns two values within one
  1875.           variable. For example, if hrs2days was asked to evaluate the time
  1876.           value of 25:00:00, it would return a string that looked like:
  1877.  
  1878.                                       1 01:00:00
  1879.  
  1880.           That's one day, plus one hour.
  1881.  
  1882.           The string can be broken apart using the SUBSTR routine, but it
  1883.           can be handled much more elegantly with the MATCH routine.
  1884.  
  1885.           Using MATCH would look like:
  1886.  
  1887.                     test.l = MATCH(hrs2days.a("25:00:00"), ".. ..", days.a,
  1888.           time.a)
  1889.  
  1890.           In this example, MATCH looks for space, as indicated by the
  1891.           second parameter, within the string returned by hrs2days. When it
  1892.           finds the space, everything to its left goes into days.a while
  1893.           everything to its right goes into time.a. The variable test.l
  1894.           receives true if the space was found, false if it was not.
  1895.  
  1896.           This routine will always return a value in the day position, even
  1897.           if the time given it to evaluate is less than a day. If the time
  1898.           is less that one day, the value will be zero.
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.                                                                          29
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.           incre
  1924.  
  1925.  
  1926.           Description:  Increments a string by one value.
  1927.  
  1928.           Syntax: newvalue.a = increment.a("oldvalue.a")
  1929.  
  1930.           Where:  newvalue.a   is the new value of the string
  1931.                   oldvalue.a   is the current value of the string
  1932.  
  1933.  
  1934.           The routine takes a string that is any mix of numbers and letters
  1935.           and increments it by one. The routine is particularly useful for
  1936.           incrementing key fields.
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                                                          30
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.           insertrec
  1990.  
  1991.           Description:  Allows the user to enter a new record.
  1992.  
  1993.           Syntax: insertrec.u ()
  1994.  
  1995.  
  1996.           The routine works from main, edit or coedit modes and opens a new
  1997.           record for the user to enter.
  1998.  
  1999.           The routine puts the new record into a WAIT RECORD and prompts
  2000.           the user to press F2 when the entry is complete. The routine also
  2001.           traps for DOS and DOSBIG to prevent accidental use of those
  2002.           commands.
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.                                                                          31
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.           isdatevalid
  2056.  
  2057.           Description:  Checks a date to see if it is valid.
  2058.  
  2059.           Syntax: testdate.l = isdatevalid.l(date2test.a)
  2060.  
  2061.           Where:  testdate.l   receives true if the date is good or false
  2062.           if it is not.
  2063.                   date2test.d  is the date to be examined
  2064.  
  2065.  
  2066.           The routine takes a string of text entered in a valid Paradox
  2067.           date format and checks to see if it is a valid date.
  2068.  
  2069.           Often data entry routines, such as the getdate2.d routine in this
  2070.           package, gathers the date as a string, then converts it to a
  2071.           date. Although the date routines in this package check for valid
  2072.           dates, this routine could be useful if you used other ways to get
  2073.           date information.
  2074.  
  2075.           The routine returns a true if the date is valid and false if it
  2076.           is not.
  2077.  
  2078.           It is important that the date be passed to the routine as a
  2079.           quoted string or in a string variable. Use of the STRVAL()
  2080.           function will fail if the date is not valid and cause a script
  2081.           error.
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.                                                                          32
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.           keygen1
  2122.  
  2123.           Description:  Generates a random number of up to five digits for
  2124.           use as a key. Routine also checks key field to make sure key
  2125.           number is not in use.
  2126.  
  2127.           Syntax: newkey.n = keygen1.n ()
  2128.  
  2129.           Where:  newkey.n  .  receives a unique number that can be used
  2130.           as a key
  2131.  
  2132.  
  2133.           When the nature of the key is not important, keygen1.n can
  2134.           provide a unique number quickly and easily. 
  2135.  
  2136.           The routine can be called from any field and will search the key
  2137.           field to see if the number generated exists. If it does exist,
  2138.           the routine will continue generating numbers until it finds one
  2139.           not in use.
  2140.  
  2141.           The routine makes no network provisions, so care should be taken
  2142.           to lock the number into the field as soon as it is returned as
  2143.           possible.
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.                                                                          33
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.           keygen2
  2188.  
  2189.           Description:  Generates a number one larger than the largest
  2190.           number in the key field.
  2191.  
  2192.           Syntax: newkey.n = keygen2.n(field.a)
  2193.  
  2194.           Where:  newkey.n  .  receives a number one larger than the
  2195.           largest in the key field.
  2196.                   field.a . .  is the name of the key field in the current
  2197.           table
  2198.  
  2199.  
  2200.           The routine can be called from any field and will find the
  2201.           largest number in the key field, increment it by one and return
  2202.           it as the new key.
  2203.  
  2204.           No network provisions are provided in this routine, care should
  2205.           be taken to lock the number into the table immediately after the
  2206.           number is returned.
  2207.  
  2208.           If no number is in the key field, the program returns 100000.
  2209.           Nearly 900,000 records can be handled in this way.
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.                                                                          34
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.           lastfirst
  2254.  
  2255.           Description:  Takes a name in the form of John Doe and returns
  2256.           Doe, John.
  2257.  
  2258.           Syntax: newname.a = lastfirst.a (fullname.a)
  2259.  
  2260.           Where:  newname.a .  is the last name followed by a comma and
  2261.           the first            name
  2262.                   fullname.a   is the full name to be affected
  2263.  
  2264.  
  2265.           The routine will handle name suffixes such as Jr., Sr., II, III
  2266.           or IV.
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.                                                                          35
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.           lastlast
  2320.  
  2321.           Description:  Takes a name in the form of Doe, John and returns
  2322.           John Doe.
  2323.  
  2324.           Syntax: newname.a = lastlast.a(fullname.a)
  2325.  
  2326.           Where:  newname.a .  is the full name of the person
  2327.                   fullname.a   is the name in last first form
  2328.  
  2329.           The routine makes allowances for middle initials and simply
  2330.           searches for the comma. Once the comma is found, the new name is
  2331.           built accordingly.
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.                                                                          36
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.           lrtrim
  2386.  
  2387.           Description:  Trims leading and trailing blanks from a string.
  2388.  
  2389.           Syntax: newstring.a = lrtrim.a(teststring.a)
  2390.  
  2391.           Where:  newname.a .  is a string with leading and trailing
  2392.           blanks removed
  2393.                   teststring.a  is a string that may contain leading or
  2394.           trailing blanks
  2395.  
  2396.  
  2397.           Particularly when importing fixed length data, blanks can be part
  2398.           of the string. This routine is used to remove those ASCII 32
  2399.           characters.
  2400.  
  2401.           The routine can be part of a PAL program or can be used within a
  2402.           scan loop in a miniscript to clean up data in a table.
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.                                                                          37
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.           ltrim
  2452.  
  2453.           Description:  Trims leading blanks from a string
  2454.  
  2455.           Syntax: newname.a = ltrim.a(teststring.a)
  2456.  
  2457.           Where:  newname.a .  is a string with leading blanks removed
  2458.                   teststring.a  is a string that may contain leading blanks
  2459.  
  2460.  
  2461.           The routine removes all ASCII 32 characters from the front of a
  2462.           string. When only leading blanks exist, the use of ltrim.a will
  2463.           be faster than lrtrim.a.
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.                                                                          38
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.           msgline
  2518.  
  2519.  
  2520.           Description:  Puts a highlighted bar on line 24 of the screen and
  2521.           centers the message on that line.
  2522.  
  2523.           Syntax: msgline.u(message.a)
  2524.  
  2525.           Where:  message.a .  is the string to be displayed
  2526.  
  2527.  
  2528.           The routine provides a way of giving the user information about
  2529.           what the program is doing.
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.                                                                          39
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.           namekey
  2584.  
  2585.           Description:  Generates a unique key based on the first and last
  2586.           name of a person.
  2587.  
  2588.           Syntax: newkey.a = namekey.a()
  2589.  
  2590.           Where:  newkey.a  .  receives a unique key based on a first and
  2591.           last name.
  2592.  
  2593.  
  2594.           One of the problems with a numeric key is that it does not sort
  2595.           the names alphabetically. That means users have no clue as to
  2596.           where a name will occur in a database and must constantly use
  2597.           locate commands.
  2598.  
  2599.           The namekey.a routine assumes there are two fields in the current
  2600.           table named "last name" and "first name." From those it
  2601.           constructs key of no more than 12 characters.
  2602.  
  2603.           The key takes the first eight letters of the last name and the
  2604.           first four letters of the first name and puts them together. In
  2605.           most cases this will provide an accurate sorting. The problem
  2606.           comes when two people of the same name are entered into the
  2607.           database.
  2608.  
  2609.           To defeat this problem, the routine goes to the first field in
  2610.           the database -- always the key field -- and checks to see if the
  2611.           newly created key exists. If so, it generates a random two-digit
  2612.           number and replaces the last two characters of the name field
  2613.           with it.
  2614.  
  2615.           For example, if you have a person in your database by the name of
  2616.           Howard Johnston, the original key would be: JohnstonHowa. If a
  2617.           second Howard Johnston were added, the key might look like:
  2618.           Johnst24Howa. 
  2619.  
  2620.           While this could cause some alphabetizing problems, the solution
  2621.           would be to have a key field wide enough to accommodate any
  2622.           possibility. Since Paradox works best with narrow tables, the
  2623.           routine was set for a maximum of 12 characters. This still allows
  2624.           for up to 100 people (00 through 99) with the same name.
  2625.  
  2626.           The routine makes no provision for network use and can only be
  2627.           called after the last name and first name fields have been
  2628.           filled. Care should be taken to post the key as soon as possible
  2629.           after the routine has been called to avoid potential conflicts on
  2630.           a network.
  2631.  
  2632.           Changes can easily be made in the source code in case the last
  2633.           name and first name fields have different names.
  2634.  
  2635.  
  2636.                                                                          40
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.           noise
  2650.  
  2651.  
  2652.           Description: Nine different noises intended to attract the user's
  2653.           attention.
  2654.  
  2655.           Syntax: noise.u(n)
  2656.  
  2657.           Where:  n . . . . .  is a number 1 through 9
  2658.  
  2659.  
  2660.           Although PAL's BEEP command can be an effective attention-getter,
  2661.           at times something else may be needed. The programmer may also
  2662.           prefer a different sound to let the user know some action has
  2663.           been completed or to draw their attention to a message.
  2664.  
  2665.           This routine offers nine such sounds. The first four are quick
  2666.           attention getters. Five and seven are short sliding sounds while
  2667.           six simulates a European siren.
  2668.  
  2669.           Eight and nine are different pitched beeps that continue until
  2670.           the user presses a key. These are intended to be used when the
  2671.           user's immediate attention is required.
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.                                                                          41
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.           nth_rec
  2716.  
  2717.  
  2718.           Description: Selects every nth record from a database, places
  2719.           them in a separate table then deletes them from the original
  2720.           database.
  2721.  
  2722.           Syntax: success.l = nth_rec.l(spacing.n)
  2723.  
  2724.           Where:  success.l .  receives a true or false indicating the
  2725.           success of the routine
  2726.                   spacing.n .  is the desired nth count
  2727.  
  2728.  
  2729.           In direct mail and other applications it may be desirable to
  2730.           select every nth record in a file. The routine plucks those
  2731.           records out. 
  2732.  
  2733.           The source code can be easily edited to remove those records from
  2734.           the original file. Comments in the code show how this is done.
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.                                                                          42
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.           num2time
  2782.  
  2783.  
  2784.           Description:  Converts a number representing the number of
  2785.           milliseconds since midnight to a standard HH:MM:SS format.
  2786.  
  2787.           Syntax: time.a = num2time.a(milliseconds.n)
  2788.  
  2789.           Where:  time.a  . .  receives the time in a HH:MM:SS format
  2790.                   milliseconds.n  is the time since midnight in milliseconds
  2791.  
  2792.  
  2793.           The Paradox TICKS () function returns the time since midnight in
  2794.           milliseconds. To make sense of the number it must be converted to
  2795.           a more readable format. This routine handles that chore.
  2796.  
  2797.           It also has a companion routine, TIME2NUM, which converts the
  2798.           standard time format to a number. This is particularly useful
  2799.           when time needs to be stored in a table. In this way it can be
  2800.           stored as a 2-byte number instead of an 8-byte string.
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.                                                                          43
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.           numbox
  2848.  
  2849.           Description:  Puts a dialog box with headline on the screen so
  2850.           the user can enter a number.
  2851.  
  2852.           Syntax: newnumber.n = numbox.n(headline.a)
  2853.  
  2854.           Where:  newnumber.n  receives the number entered by the user
  2855.                   headline.a   is the headline to put on the box
  2856.  
  2857.  
  2858.           The routine puts a dialog box on the screen and allows the user
  2859.           to enter a number. Space for a headline is provided to prompt the
  2860.           user for what number to enter. The box is sized to accommodate
  2861.           the length of the headline.
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                                                                          44
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.           numonly
  2914.  
  2915.           Description:  Searches through a string and removes any character
  2916.           that is not a number except a period.
  2917.  
  2918.           Syntax: newnumber.n = numonly.a(numberstring.a)
  2919.  
  2920.           Where:  newnumber.n  receives a number as a string variable
  2921.                   numberstring.a  is a string which may contain both letters
  2922.           and     numbers
  2923.  
  2924.  
  2925.           There are times when non-numerical data needs to be stripped out
  2926.           so that a number can be placed either into a numeric variable or
  2927.           a numeric field.
  2928.  
  2929.           The numonly.a routine strips out all string values except
  2930.           periods. A change in the source code can allow for the stripping
  2931.           of periods also.
  2932.  
  2933.           An example of this use might be to strip the dashes out of a
  2934.           telephone number or social security number so the data can be
  2935.           stored in a smaller numeric field. Of course the dashes would
  2936.           have to be reinserted when the data is read, but the savings in
  2937.           disk space may be worth the extra processor time in doing so.
  2938.  
  2939.           Note that the routine returns the data as a string. It can easily
  2940.           be converted to a number with the PAL NUMVAL function.
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.                                                                          45
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.           okbox
  2980.  
  2981.  
  2982.           Description:  Uses a dialog box to pass a one line message to the
  2983.           user. The user presses and OK button to return to the program.
  2984.  
  2985.           Syntax: okbox.u(headline.a, message.a)
  2986.  
  2987.           Where:  headline.a   is the headline for the box
  2988.                   message.a .  is the message to display in the box.
  2989.  
  2990.  
  2991.           The routine provides an easy way to present a one line message to
  2992.           the user and halt program execution until the user acknowledges
  2993.           the box.
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.                                                                          46
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.           parse
  3046.  
  3047.  
  3048.           Description:  A routine to break a string into individual parts.
  3049.  
  3050.           Syntax: count.n = parse.n(string.a, delimiter.a)
  3051.  
  3052.           Where:  count.n . .  receives the number of array elements
  3053.                   string.a  .  is the string to be parsed
  3054.                   delimiter.a  what separates each element or field
  3055.  
  3056.  
  3057.           Parse will break a string into individual pieces based on
  3058.           whatever delimited is passed.
  3059.  
  3060.           An example of how it can be used is the postal routine included
  3061.           in this package.
  3062.  
  3063.           Parse is used to break an address into pieces so the postal
  3064.           routine can examine each one and make corrections.
  3065.  
  3066.           Another example would be to prepare data in an alphanumeric field
  3067.           for conversion into a date field. If the data were in the form
  3068.           MM-DD-YY, Paradox would not allow you to restructure the table.
  3069.           The parse routine could then be used to break up MM-DD-YY using
  3070.           the dash as a delimiter. The field could then be reassembled with
  3071.           slashes which Paradox would allow to be converted into a date
  3072.           field.
  3073.  
  3074.           The routine completes its work by creating an array called
  3075.           parse.a. The array is not declared as private, so it is available
  3076.           for other routines to call. Count.n receives the number of
  3077.           elements in the array.
  3078.  
  3079.           Since the array remains global, it is wise for the programmer to
  3080.           release it when its work is complete to free up additional
  3081.           memory.
  3082.  
  3083.           It is also wise to avoid using the variable parse.a to avoid
  3084.           conflict with the array.
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.                                                                          47
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.           picktable
  3112.  
  3113.  
  3114.           Description:  Presents the user with a dialog box that can be
  3115.           used to select a table from the current directory.
  3116.  
  3117.           Syntax: chosen.a = picktable.a ()
  3118.  
  3119.           Where:  chosen.a  .  receives the name of the table chosen.
  3120.  
  3121.  
  3122.           The routine pops up a dialog box with a listing of the tables in
  3123.           the current directory. It then returns to a variable the name of
  3124.           that table. It does not place the table on the workspace.
  3125.  
  3126.           A simple change could be made in the code to allow the programmer
  3127.           to tell the routine what directory to present, however to keep
  3128.           things simple, the current directory was chosen as the default.
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.                                                                          48
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.           popcal
  3178.  
  3179.           Description:  A pop-up calendar program written entirely in PAL.
  3180.  
  3181.           Syntax: popcal.u ()
  3182.  
  3183.  
  3184.           The routine puts a window showing the current month in the center
  3185.           of the screen.
  3186.  
  3187.           The user may press the left and right arrow keys to move forward
  3188.           or behind in months. The user presses the ESC key to leave the
  3189.           routine. The system date must be accurately set for the routine
  3190.           to work correctly.
  3191.  
  3192.           The routine was intended to be called from a SETKEY command,
  3193.           however it can just as easily be called from a program when the
  3194.           user is asked to input a number.
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.                                                                          49
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.           popval
  3244.  
  3245.           Description:  A pop-up valcheck menu that allows the user to
  3246.           select an appropriate valcheck for the current field.
  3247.  
  3248.           Syntax: popval.a ()
  3249.  
  3250.  
  3251.           The routine presents a menu of 22 possible valchecks and sets the
  3252.           valcheck for the current field.
  3253.  
  3254.           The user presses the arrow keys to move the light bar to the
  3255.           appropriate valcheck, then presses ENTER to select it.
  3256.  
  3257.           Once selected the routine sets that valcheck for the current
  3258.           field. The user must be in edit mode for the routine to work.
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.                                                                          50
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.           postal
  3310.  
  3311.  
  3312.           Description: A routine to put an address in accepted postal form
  3313.  
  3314.           Syntax: newaddress.a = postal.a(address.a)
  3315.  
  3316.           Where:  newaddress.a  receives the corrected address
  3317.                   address.a .  is the address to be corrected
  3318.  
  3319.  
  3320.           While validity checks can be used to force data entry people to
  3321.           enter an address into separate fields correctly, this process can
  3322.           slow workers down. Sometimes it may be faster to allow workers to
  3323.           enter the address as a full line and have the programmer make the
  3324.           corrections.
  3325.  
  3326.           Postal handles that task. While no postal correction software is
  3327.           perfect, the routine can handle more address types and return an
  3328.           address that is postal correct.
  3329.  
  3330.           After correction, the programmer can then parse the address and
  3331.           place it into individual fields, if desired.
  3332.  
  3333.           The routine requires the use of the street database included with
  3334.           the package. This serves as the look-up for correct street names.
  3335.  
  3336.           The only known problem with the routine will come if a street
  3337.           name is the same as a street type.
  3338.  
  3339.           For example, an address of 619 East Center Street will be
  3340.           returned as 619 E Ctr St. Should these problems be too great for
  3341.           the user, the problem street names can be edited out of the
  3342.           table.
  3343.  
  3344.           Likewise, if changes are needed that aren't included in the
  3345.           table, they can be added.
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.                                                                          51
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.           printreport
  3376.  
  3377.  
  3378.           Description:  Asks the user if the report is to be printed to a
  3379.           printer, the screen or a file, then prints the report.
  3380.  
  3381.           Syntax: test.l = printreport.l(tablename.a, reportname.a)
  3382.  
  3383.           Where:  test.l  . .  is true if the report printed without error
  3384.                   tablename.a  is the name of the table hosting the report
  3385.                   reportname.a  is the report number
  3386.  
  3387.  
  3388.           When a user requests a report, printreport.l can handle all the
  3389.           details of printing it. It asks the user if it is to be printed
  3390.           to a printer, the screen or a file.
  3391.  
  3392.           If the user chooses printer, the routine checks to printer to
  3393.           make sure it is ready. If the user asks for a file, the routine
  3394.           prompts the user for the file name and checks to see if it
  3395.           already exists.
  3396.  
  3397.           The routine returns true if the report was printed or false if
  3398.           the user cancelled the effort.
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.                                                                          52
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.           proper
  3442.  
  3443.  
  3444.           Description:   Formats a string to proper case.
  3445.  
  3446.           Syntax: newstring.a = proper.a(oldstring.a)
  3447.  
  3448.           Where:  newstring.a  is the string formatted to proper case.
  3449.                   oldstring.a  is the string to be formatted.
  3450.  
  3451.  
  3452.           The routine is helpful in fixing names provided in all caps.
  3453.           However the routine will have problems with names such as
  3454.           MacDonald which will become Macdonald.
  3455.  
  3456.           This can be fixed with a look-up table if you know the problems
  3457.           names you will encounter. A description of that solution is
  3458.           included within the script.
  3459.  
  3460.           The script does successfully handle names such as McCoy and
  3461.           O'Donnell.
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.                                                                          53
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.           recordrange
  3508.  
  3509.  
  3510.           Description:  Moves records from the current table into a new
  3511.           table
  3512.  
  3513.           Syntax: recordrange.u (start.n, stop.n)
  3514.  
  3515.           Where:  start.n . .  is the first record to copy
  3516.                   stop.n  . .  is the last record to copy
  3517.  
  3518.  
  3519.           There may be times when you want to move a series of records from
  3520.           one table to another when those records have no relation other
  3521.           than that they are consecutive.
  3522.  
  3523.           It is nearly impossible to query for such an event, so
  3524.           recordrange was written to make that job easier.
  3525.  
  3526.           You call recordrange with the number of the first record you want
  3527.           to move and the number of the last record you want to move. The
  3528.           procedure then creates a table with the same structure as the
  3529.           current table.
  3530.  
  3531.           It moves to the first record to be moved, moves it to the new
  3532.           table, the continues the process until all records are copied.
  3533.  
  3534.           The new table will be named with the first six characters of the
  3535.           current table followed by an underline and a number.
  3536.  
  3537.           The procedure checks to see if that table exists, if so, it
  3538.           generates another number. If the procedure must go past nine, it
  3539.           truncates the original table name to five characters.
  3540.  
  3541.           For example the table "Mailing" would become "Mailin_1" or
  3542.           "Maili_10" if nine numbers had been used.
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.                                                                          54
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.           remblanks
  3574.  
  3575.           Description:  Removes all spaces from a string.
  3576.  
  3577.           Syntax: newstring.a = remblanks.a(oldstring.a)
  3578.  
  3579.           Where:  newstring.a  receives a string without blank spaces
  3580.                   oldstring.a  is a string that may contain blanks
  3581.  
  3582.  
  3583.           Removes all ASCII 32 characters from a string.
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.                                                                          55
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.           replace
  3640.  
  3641.  
  3642.           Description: A routine that will search for a replace a string in
  3643.           an alphanumeric field.
  3644.  
  3645.           Syntax: replace.u
  3646.  
  3647.  
  3648.           Replace will search through an entire table and replace any
  3649.           chosen string with another string. The search will take place
  3650.           only in the current field.
  3651.  
  3652.           The routine allows for confirmation of each replacement or will
  3653.           globally replace the strings without confirmation. The choice can
  3654.           be toggled by the user using the TAB key.
  3655.  
  3656.           The routine should not be confused with a CHANGETO query. For
  3657.           changing a complete field, the CHANGETO will not only be more
  3658.           efficient, but could also be much faster, depending upon the size
  3659.           of the table.
  3660.  
  3661.           Replace finds its strength in changing only part of a string. For
  3662.           example it might be used to change dashes in a date to slashes in
  3663.           preparation for restructuring a field from alphanumeric to date.
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.                                                                          56
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.           replacechar
  3706.  
  3707.  
  3708.           Description:  Searches through a string and replaces on character
  3709.           with another
  3710.  
  3711.           Syntax: replacechar.a(search.a, find.a, replace.a)
  3712.  
  3713.           Where:  search.a  .  is the string to search
  3714.                   find.a. . .  is the string to find within search.a
  3715.                   replace.a .  is the string to exchange with search.a
  3716.  
  3717.  
  3718.           The routine replaces all occurrences of a string with a new
  3719.           string. Unlike the replace routine, this does not seek
  3720.           confirmation nor does it have any user interface.
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.                                                                          57
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.           restorerec
  3772.  
  3773.           Description:  Restores last record deleted using the delrec.u
  3774.           routine.
  3775.  
  3776.           Syntax: restorerec.u ()
  3777.  
  3778.  
  3779.           The most recent record deleted using the delrec.u routine is held
  3780.           in an array in memory until the user leaves Paradox.
  3781.  
  3782.           The restorerec.u routine will restore that record even if the
  3783.           editing session has ended and the user is in main mode. The table
  3784.           must be on the workspace at the time the restoration is
  3785.           requested, but it may have been removed previously.
  3786.  
  3787.           The routine will work only for the most recent deletion.
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.                                                                          58
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.           rtrim
  3838.  
  3839.           Description:  Trims trailing spaces from a string.
  3840.  
  3841.           Syntax: newstring.a = rtrim.a (oldstring.a)
  3842.  
  3843.           Where:  newstring.a  receives a string without trailing spaces
  3844.                   oldstring.a  is a string that may have trailing spaces
  3845.  
  3846.  
  3847.           The routine will trim all trailing ASCII 32 characters from a
  3848.           string. It will be faster than lrtrim.a if only trailing are
  3849.           expected.
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.                                                                          59
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.           search
  3904.  
  3905.  
  3906.           Description:  A routine to search for any value in any field
  3907.           type.
  3908.  
  3909.           Syntax: search.u ()
  3910.  
  3911.  
  3912.           The routine will allow the user to enter up to 50 characters
  3913.           which can be sought in the current field.
  3914.  
  3915.           The routine also offers the choice of an exact or similar match.
  3916.           The choice is toggled by pressing the TAB key.
  3917.  
  3918.           Exact searches are possible in all field types, but similar
  3919.           searches are allowed only in alphanumeric fields.
  3920.  
  3921.           The routine allows for a search, then a continuation of the
  3922.           search using the familiar Paradox ALT-Z key combination.
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.                                                                          60
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.           sortarraya
  3970.  
  3971.  
  3972.           Description:  Sorts a Paradox array into ascending order.
  3973.  
  3974.           Syntax: sortarraya.v (arrayname.r)
  3975.  
  3976.           Where:  arrayname.r  is the array variable declared in the ARRAY
  3977.           statement
  3978.  
  3979.  
  3980.  
  3981.           The routine sorts an array into ascending order. This is
  3982.           particularly useful when an array is going to be used in
  3983.           SHOWARRAY or PICKARRAY call.
  3984.  
  3985.           The routine sorts only assigned elements and assumes they have
  3986.           been assigned consecutively. For example if if an array has been
  3987.           declared to 100 elements, but only 40 have been used, the routine
  3988.           will sort the 40 and place all blank elements at the end. It also
  3989.           assumes the assigned elements are 1-40. If any of those elements
  3990.           are blank, they will be included in the sort.
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.                                                                          61
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.           sortarrayd
  4036.  
  4037.  
  4038.           Description:  Sorts a Paradox array into decending order.
  4039.  
  4040.           Syntax: sortarrayd.v (arrayname.r)
  4041.  
  4042.           Where:  arrayname.r  is the array variable declared in the ARRAY
  4043.           statement
  4044.  
  4045.  
  4046.  
  4047.           The routine sorts an array into decending order. This is
  4048.           particularly useful when an array is going to be used in
  4049.           SHOWARRAY or PICKARRAY call.
  4050.  
  4051.           The routine sorts only assigned elements and assumes they have
  4052.           been assigned consecutively. For example if if an array has been
  4053.           declared to 100 elements, but only 40 have been used, the routine
  4054.           will sort the 40 and place all blank elements at the end. It also
  4055.           assumes the assigned elements are 1-40. If any of those elements
  4056.           are blank, they will be included in the sort.
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.                                                                          62
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.           statusbar
  4102.  
  4103.           Description:  A moving bar and message that graphically shows the
  4104.           user how far a process has progressed.
  4105.  
  4106.           Syntax: statusbar.u(msg.a, row.n, col.n, length.n, counter.n,
  4107.           start.n, end.n)
  4108.  
  4109.           Where:  msg.a . . .  is the message to display above the bar
  4110.                   row.n . . .  is the row where the bar is to be displayed
  4111.                   col.n . . .  is the column where the bar is to begin
  4112.                   length.n  .  is the length of the bar
  4113.                   counter.n .  is the counter position in the loop
  4114.                   start.n . .  is the beginning of the loop
  4115.                   end.n . . .  is where the loop will end
  4116.  
  4117.  
  4118.           Despite the number of variables required in a call to statusbar,
  4119.           it is very easy to use.
  4120.  
  4121.           The routine is intended to be used in a FOR/NEXT or
  4122.           WHILE/ENDWHILE loop where the number of passes through the loop
  4123.           are known.
  4124.  
  4125.           Here is a sample of how statusbar.u might be used:
  4126.  
  4127.                   FOR x from 1 to 500
  4128.                   statusbar.u("Processing data", 5, 1, 20, x, 1,
  4129.                   500)
  4130.                   ....
  4131.                   ....
  4132.                   ....
  4133.                   ENDFOR
  4134.  
  4135.           The routine will calculate the percentage of how far the loop the
  4136.           counter gone, apply that percentage to the length of the bar,
  4137.           then display the bar. With each pass through the loop, the
  4138.           calculation is updated, allowing the use of the STEP statement in
  4139.           the FOR loop.
  4140.  
  4141.           While the routine will handle any length for the bar up to one
  4142.           screen width.
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.                                                                          63
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.           striphigh
  4168.  
  4169.           Description:  Strips all ASCII characters above 126 out of a
  4170.           string.
  4171.  
  4172.           Syntax: newstring.a = striphigh.a(oldstring.a)
  4173.  
  4174.           Where:  newstring.a  receives a string of ASCII characters below
  4175.           127
  4176.                   oldstring.a  is a string that may contain ASCII
  4177.           characters above     126
  4178.  
  4179.  
  4180.           The routine will strip all high ASCII characters out of a string
  4181.           that may cause problems with some printers.
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.                                                                          64
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.           syscheck
  4234.  
  4235.  
  4236.           Description:  Displays a dialog box with information about the
  4237.           computer system.
  4238.  
  4239.           Syntax: syscheck.u ()
  4240.  
  4241.  
  4242.           Displays a dialog box giving information about memory, the
  4243.           hardware being used and the current Paradox state.
  4244.  
  4245.           It's good for user information and to help diagnosis system
  4246.           problems when on the telephone with a user.
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.                                                                          65
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.           textbox
  4300.  
  4301.           Description:  Prompts the user to enter a line of text and
  4302.           formats it to all caps, all lower case or with only the first
  4303.           letter of each word capitalized.
  4304.  
  4305.           Syntax: newstring.a = textbox.a(headline.a, length.n, styl.n)
  4306.  
  4307.           Where:  newstring.a  receives a formatted string of text
  4308.                   headline.a   is the headline to place on the box
  4309.                   length.n  .  is the number of characters to be entered
  4310.                   styl.n  . .  is the style to format the new text
  4311.  
  4312.  
  4313.           Using a dialog box, textbox.a prompts the user for a one line
  4314.           text string. A headline can be put on the box to prompt the user
  4315.           as to what text to enter. The length.n variable determines how
  4316.           long the string can be.
  4317.  
  4318.           Although the routine can handle strings of up to 80 characters,
  4319.           the dialog box runs off the screen. The routine will look best
  4320.           when used with lengths of 64 or less.
  4321.  
  4322.           If styl.n is set to 1, the text will be returned to newstring.a
  4323.           in all capitals. If it is set to 2, the string will be returned
  4324.           in all lower case. If it is set to 3, the first letter of each
  4325.           word will be capitalized. If any other number is used, the text
  4326.           will be returned unaltered.
  4327.  
  4328.           The routine also uses the lrtrim.a function to trim any leading
  4329.           or trailing from the string.
  4330.  
  4331.           If the user exits without entering any text, the routine returns
  4332.           a value of false.
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.                                                                          66
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.           timeadd
  4366.  
  4367.  
  4368.           Description:  Adds two time values.
  4369.  
  4370.           Syntax: totaltime.a = timeadd.a(timevalue1.a, timevalue2.a)
  4371.  
  4372.           Where:  totaltime.a  is the total of timevalue1.a plus
  4373.           timevalue2.a
  4374.  
  4375.  
  4376.           Paradox allows you to capture the current time, but it does not
  4377.           allow math with it. This routine allows you to add two time
  4378.           values. It has two companion routines. One allows subtraction
  4379.           while the other, hrs2days, tells you the number of days which
  4380.           accrued if the addition results in more than 24 hours.
  4381.  
  4382.           The timevalues must be strings in the HH:MM:SS format to be used
  4383.           in this routine.
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.                                                                          67
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.           time2num
  4432.  
  4433.  
  4434.           Description:  Converts the time in HH:MM:SS format to a number.
  4435.  
  4436.           Syntax: timenum.n = time2num.n(time.a)
  4437.  
  4438.           Where:  timenum.n .  receives the time number value
  4439.                   time.a  . .  is the time in HH:MM:SS format
  4440.  
  4441.  
  4442.           Because numbers take up less space than the time format in a
  4443.           Paradox table, it may be worthwhile to store the time as a
  4444.           number. This routine converts a standard time format to the
  4445.           number of milliseconds since midnight.
  4446.  
  4447.           The format is the same as used by the Paradox TICKS () function.
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.                                                                          68
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.           timesub
  4498.  
  4499.  
  4500.           Description:  Subtracts one time value from another.
  4501.  
  4502.           Syntax: newtime.a = timesub.a(timevalue1.a, timevalue2.a)
  4503.  
  4504.           Where:  newtime.a .  receives the result of subtraction
  4505.           timevalue2.a from timevalue1.a
  4506.  
  4507.  
  4508.           The routine subtracts the second time value from the first time
  4509.           value. The values must be in the HH:MM:SS format.
  4510.  
  4511.           The routine allows negative results and returns a nine position
  4512.           value instead of the expected eight positions. Programmers using
  4513.           this routine should check for a negative value before attempting
  4514.           to plug the results of the routine into an 8-character field
  4515.           unless the results will always be positive.
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.                                                                          69
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.           uniquename
  4564.  
  4565.  
  4566.           Description:  Generates a unique string that can be used as a
  4567.           file name.
  4568.  
  4569.           Syntax: filename.a = uniquename.a ()
  4570.  
  4571.           Where:  filename.a   receives the new file name.
  4572.  
  4573.  
  4574.           After generating an answer table, the table must often be renamed
  4575.           while other queries are done. These names may be hard-coded, but
  4576.           then the program must always check to see if such a file already
  4577.           exists.
  4578.  
  4579.           The routine generates a five-digit number, checks to see if a
  4580.           file by that name exists, then returns the number if no such file
  4581.           exists. The name may then be used as a new name for the answer
  4582.           table.
  4583.  
  4584.           The name can also be reused later if the table is to be deleted.
  4585.  
  4586.           The returned string carries no file name extension, so the string
  4587.           can be used to name any kind of file.
  4588.  
  4589.           The extra-cautious programmer would also check the file name
  4590.           against the ISTABLE () command to make sure no tables exist. In
  4591.           some situations, tables created during a Paradox session may not
  4592.           yet be stored on disk. The check is not included in the routine
  4593.           in case the name is to be used for a different purpose.
  4594.  
  4595.           This eventuality, however, is rare unless many temporary tables
  4596.           were being created as part of the program.
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.                                                                          70
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.           waitkeypress
  4630.  
  4631.           Description:  Creates a pause until the user presses a key.
  4632.  
  4633.           Syntax: waitkeypress.v ()
  4634.  
  4635.                   or
  4636.  
  4637.                   charpicked.a = waitkeypress.v ()
  4638.  
  4639.           Where:  charpicked.a  is the key pressed
  4640.  
  4641.  
  4642.           The routine is used to halt program execution until a key is
  4643.           pressed. If knowing the key is important, the function version of
  4644.           the routine can be used.
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.                                                                          71
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.           wipes
  4696.  
  4697.           Description:  A demonstration program to show how wipes can be
  4698.           added to a program.
  4699.  
  4700.           Syntax: wipes.u ()
  4701.  
  4702.  
  4703.           Wipes is included only to show that wipes can be done with PAL.
  4704.           The source code shows how wipes can be written into programs.
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.                                                                          72
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.           workwindow
  4762.  
  4763.  
  4764.           Description:  Places a floating window on the screen telling the
  4765.           user that work is being done behind the scenes.
  4766.  
  4767.           Syntax: windowhandle = workwindow.n ()
  4768.  
  4769.           Where:  windowhandle  receives the handle of the window opened.
  4770.  
  4771.  
  4772.           The routine puts a floating window in the center of the screen
  4773.           with the flashing message: Working.
  4774.  
  4775.           Because the window is floating, it will remain at the top of all
  4776.           other windows. It is then up to the programmer to close the
  4777.           window when it is no longer needed. That is done by calling the
  4778.           window select command to make window current, then using the
  4779.           window close command.
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.                                                                          73
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.